/*
#include <ifp_device.h>
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-11-20     great_master       the first version
 */
#include "humidity.h"
#include "relay.h"
#include "ifp_def.h"

static void humidity_control_entry(void *parameter)
{
    uint8_t humidity;
    //relay_init();
    humidity_init();

    while(true)
    {
        get_current_humidity(&humidity);
        rt_thread_delay(1000);
    }
}

int iw_device_threat_init(void)
{
    rt_thread_t tid = RT_NULL;
 /* 创建线程，名称是 pwm_thread ，入口是 pwm_entry*/
    tid = rt_thread_create("hu_thread",
                           humidity_control_entry,
                           RT_NULL,
                           1024,
                           7,
                           20);

    /* 如果获得线程控制块，启动这个线程 */
    if (tid != RT_NULL)
        if(rt_thread_startup(tid) == RT_EOK)
        {
            rt_kprintf("device thread start up success\r\n");
        }

    return RT_EOK;
}





